<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh-CN">
<head>
<title></title>
<#include "top.html">
<div class="wrap">
<div class="box">
<div class="content">
<script>
function resetcode(){
	var i=parseInt(10*Math.random()); 
	var url='${base}/captcha.vsl?t='+new Date().getTime();
	$('#validatecode').attr('src',url);
}

function checklogin(){
	var userName = $("#txt_username");
	var userNameMsg = $("#txt_usernameMsg");
	if(userName.val()==""){
		userNameMsg.html("<div class='n_i_m_e'>用户名不能为空！</div>");
	}else{
		userNameMsg.html("");
	}		

	var password = $("#txt_password");
	var passwordMsg = $("#passwordMsg");
		
	if(password.val()==""){
		passwordMsg.html("<div class='n_i_m_e'>密码不能为空！</div>");
	}else{
		passwordMsg.html("");
	}
			

	var verifyCode = $("#txt_verifycode");
	var verifyCodeMsg = $("#verifyCodeMsg");
		
	if(verifyCode.val()==""){
		verifyCodeMsg.html("<div class='n_i_m_e' style='vertical-align: middle;float:left'>验证码不能为空！</div>");
	}else{
		verifyCodeMsg.html("");
	}
	if(userName.val()=="" || password.val()=="" || verifyCode.val()==""){
		return false;
	}

	$.ajax({
	    type: 'post',
        dataType: 'json',
        data :{'username':userName.val(),'j_captcha':verifyCode.val(),'password':password.val()},
        url: site_root+'/front/userlogin.htm',
        cache : false,
        error: function(){
            alert('系统繁忙，请稍后再试');   
        },
        success: function(data){
        if(data.status=='success'){
           window.location.href="${base}/";
        }else{
           alert(data.message);
        }
         return ;
        }
    });
	
}

$(function(){

	var $userName = $("#txt_username");
	var $userNameMsg = $("#txt_usernameMsg");
	$userName.blur(function(){		
		if($userName.val()==""){
			$userNameMsg.html("<span class='n_i_m_e'>用户名不能为空！</span>");
			return ;
		}else{
			$userNameMsg.html("");
		}
				
	});

	var $password = $("#txt_password");
	var $passwordMsg = $("#passwordMsg");
	$password.blur(function(){		
		if($password.val()==""){
			$passwordMsg.html("<span class='n_i_m_e'>密码不能为空！</span>");
		}else{
			$passwordMsg.html("");
		}
			
	});

	var $verifyCode = $("#txt_verifycode");
	var $verifyCodeMsg = $("#verifyCodeMsg");
	$verifyCode.blur(function(){	
		if($verifyCode.val()==""){
			$verifyCodeMsg.html("<span class='n_i_m_e'>验证码不能为空！</span>");
		}else{
			$verifyCodeMsg.html("");
		}
	});
	
	
});


</script>

<link href="${base}/res/front/css/user.css" rel="stylesheet" type="text/css" />
<div class="clearfix" style="padding: 20px 0;">
<div class="s_loginright login_left" style="padding:10px 0 0 20px ;">
<div class="s_loginbox">
<div class="s_boxhead"></div>
<div class="clearfix">
   <div id="msgDiv" class="s_wrong">&nbsp;</div>
   <div class="s_boxleft clearfix" style="width:100%;">
   <div class="clearfix">
     <span class="s_label">用户名</span> 
     <input type="text" value="" name="username" id="txt_username" class="s_inputtext1 s_input unchecked" tabindex="3"/>
     <span id="txt_usernameMsg"></span>
   </div>
   <div class="clearfix">
     <span class="s_label">密&nbsp;&nbsp;&nbsp;码</span> 
     <input type="password" name="password" id="txt_password" class="s_inputtext1 s_input" tabindex="3"/>
     <span id ="passwordMsg"></span>	
   </div> 
	 <div class="clearfix">
     <span class="s_label">验证码</span> 
     <input class="s_inputtext1 s_input" type="text" style="width:60px;" id="txt_verifycode" name="j_captcha" maxlength="6" tabindex="3"/>                   
     <img  id="validatecode"  style="margin:5px 8px 0 0;cursor: pointer; float:left;width:70px;"  title="更换验证码" src="/captcha.vsl" onclick="resetcode();" />
     <span id="verifyCodeMsg" style="vertical-align: middle;float:left"></span>
   </div>  
</div>  
<div class="clearfix" style="text-align:right;height:16px;line-height:16px;overflow:hidden;margin-bottom:5px;" >
 	<span class="s_label"></span><a href="act-forget.html">忘记密码</a>|<a style="color:#f60;" href="${base}/front/register.htm">免费注册</a>
</div>  
<div class="clearfix" >
  <span class="s_label"></span><img style="cursor:pointer;" src="${base}/res/front/images/btn_login.gif" onclick="checklogin()"/>
</div>        
</div>
</div>
</div>

<div class="login_right" style="width:470px;"> <p class="t4"><img src="${base}/res/front/images/login/login_03.gif" /></p>
  <span class="a"><strong class="FF4000">超低价买正品：</strong><span class="gray8">本站以独特的竞拍购物方式，助您以超低的价格赢得最炫的宝贝！</span></span> 
  <span class="a t3"><strong class="FF4000">积返退补保障：</strong><span class="gray8">本站以丰富的商品属性保障，使您竞拍风险迅速下降！</span></span>
  <span class="a t3"><strong class="FF4000">快速物流服务：</strong><span class="gray8">本站已与全国知名物流公司签约，可覆盖全国各大中城市，快速送达！</span></span>
  <span class="a t3"><strong class="FF4000">奖励回馈丰厚：</strong><span class="gray8">凡成功注册本站用户免费获5粒体验豆，通手机验证再送3粒乐豆！</span></span>
  <a href="act-register.html"><p class="registersumbit t1"></p></a>
</div>
</div>

<div class="clear"></div>
</div>
</div>
</div>
<br/>
<#include "foot.html">
</body>
</html>
